package cn.brilliantfuture.commentry.entity;

// Generated 2010-9-25 13:15:16 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.Max;
import org.hibernate.validator.Min;
import org.hibernate.validator.NotNull;

/**
 * LockersModel generated by hbm2java
 */
@Entity
@Table(name = "lockers_model", catalog = "cabinet")
public class LockersModel implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer lockersModelId;
	private String name;
	private String model;
	private int ledNum = 1;
	private String description;
	private Integer gridCount;
	private Integer gridHigh;
	private Integer gridWide;
	private Integer gridLong;
	private Integer lockersHigh;
	private Integer lockersWide;
	private Integer lockersLong;
	private boolean hasDevice;
	private boolean hasSensor;
	private boolean hasGeneral;
	private boolean hasThermostat;
	private boolean hasKeepWarm;
	private Date insertTime;
	private Integer insertUser;
	private boolean deleted;
	
	private Set<Lockers> lockerses = new HashSet<Lockers>(0);

	public LockersModel() {
	}

	public LockersModel(Set<Lockers> lockerses, String name, String model, boolean deleted) {
		this.lockerses = lockerses;
		this.name = name;
		this.model = model;
		this.deleted = deleted;
	}

	public LockersModel(Set<Lockers> lockerses, String name, String model,
			String description, Integer gridCount, Integer gridHigh,int ledNum,
			Integer gridWide, Integer gridLong, Integer lockersHigh,
			Integer lockersWide, Integer lockersLong, boolean hasDevice,
			boolean hasSensor, boolean hasThermostat, boolean hasKeepWarm,
			Date insertTime, Integer insertUser, boolean deleted) {
		this.ledNum = ledNum;
		this.lockerses = lockerses;
		this.name = name;
		this.model = model;
		this.description = description;
		this.gridCount = gridCount;
		this.gridHigh = gridHigh;
		this.gridWide = gridWide;
		this.gridLong = gridLong;
		this.lockersHigh = lockersHigh;
		this.lockersWide = lockersWide;
		this.lockersLong = lockersLong;
		this.hasDevice = hasDevice;
		this.hasSensor = hasSensor;
		this.hasThermostat = hasThermostat;
		this.hasKeepWarm = hasKeepWarm;
		this.insertTime = insertTime;
		this.insertUser = insertUser;
		this.deleted = deleted;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "lockers_model_id", unique = true, nullable = false)
	public Integer getLockersModelId() {
		return this.lockersModelId;
	}

	public void setLockersModelId(Integer lockersModelId) {
		this.lockersModelId = lockersModelId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "lockersModel")
	public Set<Lockers> getLockerses() {
		return lockerses;
	}

	public void setLockerses(Set<Lockers> lockerses) {
		this.lockerses = lockerses;
	}

	@Column(name = "name", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "model", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getModel() {
		return this.model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	@Column(name = "description", length = 256)
	@Length(max = 256)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "grid_count")
	@Min(value = 1,message = "不能是负数,最小为1.")
	@Max(value = 99, message = "最大值99.")
	public Integer getGridCount() {
		return this.gridCount;
	}

	public void setGridCount(Integer gridCount) {
		this.gridCount = gridCount;
	}

	@Column(name = "grid_high")
	@Min(value = 1,message = "不能是负数或0.")
	public Integer getGridHigh() {
		return this.gridHigh;
	}

	public void setGridHigh(Integer gridHigh) {
		this.gridHigh = gridHigh;
	}

	@Column(name = "grid_wide")
	public Integer getGridWide() {
		return this.gridWide;
	}

	public void setGridWide(Integer gridWide) {
		this.gridWide = gridWide;
	}

	@Column(name = "grid_long")
	public Integer getGridLong() {
		return this.gridLong;
	}

	public void setGridLong(Integer gridLong) {
		this.gridLong = gridLong;
	}

	@Column(name = "lockers_high")
	public Integer getLockersHigh() {
		return this.lockersHigh;
	}

	public void setLockersHigh(Integer lockersHigh) {
		this.lockersHigh = lockersHigh;
	}

	@Column(name = "lockers_wide")
	public Integer getLockersWide() {
		return this.lockersWide;
	}

	public void setLockersWide(Integer lockersWide) {
		this.lockersWide = lockersWide;
	}

	@Column(name = "lockers_long")
	public Integer getLockersLong() {
		return this.lockersLong;
	}

	public void setLockersLong(Integer lockersLong) {
		this.lockersLong = lockersLong;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "insert_user")
	public Integer getInsertUser() {
		return this.insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}

	@Column(name = "deleted", nullable = false)
	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@Column(name = "led_num")
	public int getLedNum() {
		return ledNum;
	}

	public void setLedNum(int ledNum) {
		this.ledNum = ledNum;
	}

	@Column(name = "has_device")
	public boolean isHasDevice() {
		return hasDevice;
	}

	public void setHasDevice(boolean hasDevice) {
		this.hasDevice = hasDevice;
	}

	@Column(name = "has_sensor")
	public boolean isHasSensor() {
		return hasSensor;
	}

	public void setHasSensor(boolean hasSensor) {
		this.hasSensor = hasSensor;
	}

	@Column(name = "has_general")
	public boolean isHasGeneral() {
		return hasGeneral;
	}

	public void setHasGeneral(boolean hasGeneral) {
		this.hasGeneral = hasGeneral;
	}

	@Column(name = "has_thermostat")
	public boolean isHasThermostat() {
		return hasThermostat;
	}

	public void setHasThermostat(boolean hasThermostat) {
		this.hasThermostat = hasThermostat;
	}

	@Column(name = "has_keep_warm")
	public boolean isHasKeepWarm() {
		return hasKeepWarm;
	}

	public void setHasKeepWarm(boolean hasKeepWarm) {
		this.hasKeepWarm = hasKeepWarm;
	}

}
